/**
* This file is part of mobileworks.
*
* mobileworks is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
* along with dev.clipall.  If not, see <http://www.gnu.org/licenses/>.
*
* https://code.google.com/p/mobileworks/
*/

/*
 * LineBorder.java
 * Created on July 28, 2007, 10:41 AM
 */

package view.border;

import javax.microedition.lcdui.Graphics;
import view.Color;
import view.Component;
import view.GuiUtils;

/**
 * @author Erol Hira
 */
public class LineBorder extends Border {
        
    private Color color;        
    
    
    public LineBorder(int w_left, int w_right, int w_top, int w_bottom, Color color){
        super(w_left, w_right, w_top, w_bottom);
        this.color = color;
    }

    public void paint(Graphics g, Component component) {
        
        GuiUtils.setColor(g, color);
        
        g.drawRect(component.getX(),
                    component.getY(),
                    component.getWholeWidth() - 1,
                    component.getWholeHeight() - 1);
    }
    
    //----------------------------------------------------------------------
    
    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }    
    
}
